package com.wondertek.poms.core.filter.impl;

import com.wondertek.poms.core.filter.BaseRuleFilter;
import com.wondertek.poms.core.filter.RuleFilterChain;
import com.wondertek.poms.dao.po.Content;
import com.wondertek.poms.dao.po.IRulePo;
import com.wondertek.poms.dao.po.PcProductRule;
import com.wondertek.poms.dao.po.PrdInfoRule;


/**
 * <p><b>CopyRightAreaFilter Description:</b> 版权地域范围白名单过滤器</p>
 * @author douzi
 * <b>DATE</b> 2019年9月27日 下午4:45:27
 */
public class CopyRightWhiteAreaFilter extends BaseRuleFilter {

	@Override
	public void doFilter(IRulePo rule, Content c, RuleFilterChain chain) {
		if (rule instanceof PrdInfoRule) {
			PrdInfoRule r = (PrdInfoRule) rule;
			this.specialFilter(r.getPrdRuleId(), 
					r.getCopyRightArea(), 
					c.getArea(), 
					chain, 
					"版权地域范围白名单-Area");
		} else if(rule instanceof PcProductRule){
            PcProductRule r= (PcProductRule) rule;
            this.specialFilter(r.getId(),
					r.getArea(),
					c.getArea(),
					chain,
					"版权地域范围白名单-Area");
        }
		
		chain.doFilter(rule, c, chain);
	}

}
